package cn.wolfcode.wolf2w.controller;

import cn.wolfcode.wolf2w.annotation.LoginAnnotation;
import cn.wolfcode.wolf2w.annotation.UserParams;
import cn.wolfcode.wolf2w.domain.TravelComment;
import cn.wolfcode.wolf2w.domain.UserInfo;
import cn.wolfcode.wolf2w.query.TravelCommentQuery;
import cn.wolfcode.wolf2w.redis.service.IUserInfoRedisService;
import cn.wolfcode.wolf2w.service.IDestinationService;
import cn.wolfcode.wolf2w.service.ITravelCommentService;
import cn.wolfcode.wolf2w.service.IUserInfoService;
import cn.wolfcode.wolf2w.util.JsonResult;
import cn.wolfcode.wolf2w.util.UMEditorUploader;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;


/**
 * Created by 甘静斌 on 2020-08-11 21:19
 */
@RestController
@RequestMapping("travelComments")
public class TravelCommentController {
    
    @Autowired
    private ITravelCommentService travelCommentService;
    

    @GetMapping("/query")
    public Object query(TravelCommentQuery qo){

        Page<TravelComment> page = travelCommentService.query(qo);
        return JsonResult.success(page);
    }


    /**
     * 用户注入对象 ,演示是否正确
     * @param userInfo
     * @return
     */
    @GetMapping("/info")
    public Object info(@UserParams UserInfo userInfo){
        return JsonResult.success(userInfo);
    }

    
}
